package com.beta.em;

/**
 * Created by vector on 2016/11/17.
 */
public enum UserStatus {

    REGISTED("registed", "已注册"),
    PENDING("pending", "待审核"),
    LOCKED("locked", "已锁定"),
    CLOSED("closed", "已销户"),
    ACTIVE("active", "已激活"),
    DENIED("denied", "已拒绝");

    private String value;

    private String cnValue;

    private UserStatus(String value, String cnValue) {
        this.value = value;
        this.cnValue = cnValue;
    }

    public String getValue() {
        return this.value;
    }

    public String getCnValue() {
        return this.cnValue;
    }

    public static String getCnValue(String value) {
        String cnValue;
        for (UserStatus status: values()) {
            if (status.getValue().equals(value)) {
                return status.getCnValue();
            }
        }
        return null;
    }

}
